<?php
namespace app\api\controller;

use think\Controller;
use app\api\model\Userwater;

class Userwaters extends Controller
{
    public function index()
    {
        if (request()->isGet()){
            AjaxReturn('10020','传值方式错误');
            die;
        }
        if(request()->isPost()) {
            $userid = input('id');
            $style = input('style');
            $flowing = new Userwater();
            $data = $flowing->index($userid, $style);
            if ($data == 0) {
                AjaxReturn('暂未查到此用户的相关明细');
            } else {
                AjaxReturn('1', '成功', ['details' => $data]);
            }
        }
    }
}